<script>
	export default {
		onLaunch: function() {
			console.log('App Launch')
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		},
		globalData: {  
			isRealName:false, //判定是否实名
			hasLogin:false, //判定是否登录
		},
		methods: {
			//判断是否在微信中
			isWechat: function() {
				var ua = window.navigator.userAgent.toLowerCase();
				if (ua.match(/micromessenger/i) == 'micromessenger') {
					//console.log('是微信客户端')  
					return true;
				} else {
					//console.log('不是微信客户端')  
					return false;
				}
			},
			//日期转换
			timeConversion(dateData) {
				var date = new Date(dateData.replace(/-/g, '/'))
				var y = date.getFullYear()
				var m = date.getMonth() + 1
				m = m < 10 ? ('0' + m) : m
				var d = date.getDate()
				d = d < 10 ? ('0' + d) : d
				var time = y + '-' + m + '-' + d;
				// this.ruleForm.duedate=time;
				return time
			},
			getLogin() { //微信授权登录
				var local = window.location.href //获取页面当前路径
				
				local = local.split('?')[0]
				var linkJump = this.getUrlParam('linkJump')
				if (linkJump != null && linkJump !== '') {
					local = local +'?linkJump='+linkJump
				} 
				// console.log(local)
				let appid = this.appId
				let redirect_uri = encodeURIComponent(local)
				let response_type = 'code'
				let scope = "snsapi_base"
				let state = "STATE#wechat_redirect"
				console.log(redirect_uri)
				console.log(local)
				location.href =
					"https://open.weixin.qq.com/connect/oauth2/authorize?appid=" + appid + '&redirect_uri=' +
					redirect_uri + '&response_type=' + response_type + '&scope=' + scope + '&state=' + state
			},
			getUrlParam(name) {
				var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)')
				var r = window.location.search.substr(1).match(reg)
				if (r != null) return unescape(r[2])
				return null
			},
			async validate_realName_login(){
				var data = {
					realName:false,
					login:false
				}
				if(this.$queue.getData('token') != undefined){
					   data.login = true
					var res = await this.$api.getRealNameInfo()
					if(res.data.idCard == '' || res.data.name == ''){
						data.realName = false
					}else{
						data.realName = true
					}
				}
				return data

			}


		},
	}
</script>

<style>
	/*每个页面公共css */
	/* 一行溢出 */
	.ellipseHide {
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}

	/* 两行行溢出 */
	.ellipseHide_two {
		overflow: hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-line-clamp: 2;
		-webkit-box-orient: vertical;
	}

	/* 公共底部loding加载 */
	.bottomLoading {
		padding-top: 20rpx;
		padding-bottom: 100rpx;
		width: 100%;
		text-align: center;
		color: #999999;
		font-size: 28rpx;
	}
	.button:active{
		opacity: 0.8;
	}
	.no_info {
		width: 100%;
		height: 100%;
		display: flex;
		flex-direction: column;
		align-items: center;
		padding-top: 448rpx;
	}
    /* 去除scroll滚动条 */
    ::-webkit-scrollbar {
        display: none;
        width: 0;
        height: 0;
        background-color: transparent;
    }
	.no_info text {
		color: #999999;
		font-size: 26rpx;
	}

	.no_info image {
		width: 480rpx;
		height: 268rpx;
		margin-bottom: 18rpx;
	}

	.unsetBo {
		border: unset;
	}

	.imgBox {
		width: 100%;
		height: 100%;
	}
	uni-rich-text{
		word-break:break-all;
	}
	uni-rich-text img {
		max-width: 100% !important;
		height: auto !important; 
	}
	uni-rich-text p{
	   max-width: 100%;
	   word-break:break-all;
	}
	uni-tabbar, uni-tabbar .uni-tabbar{  
	       box-shadow: 0px -10rpx 8rpx #F3F3F3;
	    }
    
</style>
